application window: Make menubar appear
authorMatthias Clasen <mclasen@redhat.com>
Sun, 8 Oct 2017 02:24:09 +0000 (22:24 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 8 Oct 2017 02:24:09 +0000 (22:24 -0400)
This needed to be ported to snapshot, still.

gtk/gtkapplicationwindow.c

index 37c87e34898cfb0bef8082de0b58a3f68644b171..8eda444ea57aee8cf8b9f459575352347cf134d9 100644 (file)
@@ -798,6 +798,18 @@ gtk_application_window_init (GtkApplicationWindow *window)
                             G_CALLBACK (g_action_group_action_removed), window);
 }
 
+static void
+gtk_application_window_snapshot (GtkWidget   *widget,
+                                 GtkSnapshot *snapshot)
+{
+  GtkApplicationWindow *window = GTK_APPLICATION_WINDOW (widget);
+
+  GTK_WIDGET_CLASS (gtk_application_window_parent_class)->snapshot (widget, snapshot);
+
+  if (window->priv->menubar)
+    gtk_widget_snapshot_child (widget, window->priv->menubar, snapshot);
+}
+
 static void
 gtk_application_window_class_init (GtkApplicationWindowClass *class)
 {
@@ -806,12 +818,15 @@ gtk_application_window_class_init (GtkApplicationWindowClass *class)
   GObjectClass *object_class = G_OBJECT_CLASS (class);
 
   container_class->forall = gtk_application_window_real_forall_internal;
+
   widget_class->measure = gtk_application_window_measure;
   widget_class->size_allocate = gtk_application_window_real_size_allocate;
   widget_class->realize = gtk_application_window_real_realize;
   widget_class->unrealize = gtk_application_window_real_unrealize;
   widget_class->map = gtk_application_window_real_map;
   widget_class->unmap = gtk_application_window_real_unmap;
+  widget_class->snapshot = gtk_application_window_snapshot;
+
   object_class->get_property = gtk_application_window_get_property;
   object_class->set_property = gtk_application_window_set_property;
   object_class->dispose = gtk_application_window_dispose;